package com.tsj.mvp.demo2;

/**
 * 专门复制交互（中介，关联view和model）
 * */
public class LoginPresenter {

    public LoginModel loginModel;
    public LoginView loginView;

    public LoginPresenter(LoginView loginView){
        loginModel = new LoginModel();
        this.loginView = loginView;
    }

    public void login(String username,String password){
        loginModel.login(username, password, new LoginModel.CallBack() {
            @Override
            public void callback(String result) {
                if(loginView != null){
                    loginView.onLoginResult(result);
                }
            }
        });
    }
}
